//
//  ViewController.m
//  11203
//
//  Created by student on 16/3/3.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic,strong) NSArray *countryArr;
@property (nonatomic,strong) NSArray *imageArr;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.countryArr = [[NSArray alloc] initWithObjects:@"A1-南非",@"A2-墨西哥",
                       @"B1-阿根廷",@"B2-尼日利亚",@"C1-英格兰",@"C2-美国",
                       @"D1-德国",@"D2-澳大利亚",@"E1-荷兰",@"E2-丹麦",
                       @"G1-巴西",@"G2-朝鲜",@"H1-西班牙",@"H2-瑞士",nil];
    self.imageArr = [[NSArray alloc] initWithObjects:@"SouthAfrica.png",@"Mexico.png",
                     @"Argentina.png",@"Nigeria.png",@"England.png",@"USA.png",
                     @"Germany.png",@"Australia.png",@"Holland.png",@"Denmark.png",                      @"Brazil.png",@"NorthKorea.png",@"Spain.png",@"Switzerland.png",nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.countryArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"Cell"];
    if (cell == nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"Cell"];
    }
    cell.textLabel.text = self.countryArr[indexPath.row];
    cell.imageView.image = [UIImage imageNamed: self.imageArr[indexPath.row]];
    return cell;
}
@end
